<template>
  <div>
    <h3>Add Admin</h3>
    <input type="text" v-model="inputAdminName" placeholder="Name" />
    <input type="text" v-model="inputAdminPassword" placeholder="Password" />
    <button @click="submitAdminAdd">ADD</button>
  </div>
</template>

<script>
import { createNamespacedHelpers } from "vuex";
const { mapActions } = createNamespacedHelpers("admin");
export default {
  data() {
    return {
      inputAdminName: "",
      inputAdminPassword: "",
    };
  },
  methods: {
    ...mapActions(["addAdmin"]),
    submitAdminAdd() {
      let data = {
        username: this.inputAdminName,
        password: this.inputAdminPassword,
      };
      this.addAdmin(data);
    },
  },
};
</script>
